<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>菏泽学院</title>
    <link rel="stylesheet" type="text/css" href="easyUI/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyUI/themes/icon.css">
    <script type="text/javascript" src="easyUI/jquery.min.js"></script>
    <script type="text/javascript" src="easyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="javascript/addressIP.js"></script>
    <script type="text/javascript" src="javascript/datagrid-filter.js"></script>
</head>
<body>
<script>
    $(function () {
        var loadpaperlisturl = ipAddress + "studentGetPaperList";
        $.ajax({
            type:'get',
            dataType:'json',
            url:loadpaperlisturl,
            beforeSend:function (request) {
                request.setRequestHeader("token",localStorage.getItem("token"));
            },
            success:function (returndata) {
                $('#studentJudgeRecord').datagrid({
                    data:returndata,
                    striped: true,
                    border:false,
                    singleSelect:true,
                    idField: 'paperID',
                    fit:true,
                    fitColumns:true,
                    loadMsg:'^_^请稍等',
                    emptyMsg: '您还没有发布题目呢',
                    pagination:true,
                    pageSize: 10,
                    pageList: [10, 20, 30],
                    columns: [
                        [
                            {
                                field: 'paperID',
                                title: '论文编号',
                                width: '7%',
                                align: 'center'
                            },
                            {
                                field: 'executePlan',
                                title: '审批阶段',
                                width: '14%',
                                align: 'center',
                                formatter: function(value,row,index) {
                                    if (row.executePlan){
                                        return "<span title='" + row.executePlan.content + "'>" + row.executePlan.content + "</span>";
                                    } else {
                                        return value;
                                    }
                                }
                            },
                            {
                                field: 'checkState',
                                title: '审批状态',
                                width: '8%',
                                align: 'center',
                                formatter: function(value,row,index) {
                                    if(row.checkState == 0){
                                        return '未审批';
                                    }else{
                                        return '已审批';
                                    }
                                }
                            },
                            {
                                field: 'studentWord',
                                title: '我的[留言/简介]',
                                width: '18%',
                                align: 'center',
                                formatter: function(value,row,index) {
                                    return "<span title='" + row.studentWord + "'>" + row.studentWord + "</span>";
                                }
                            },
                            {
                                field: 'teacherWord',
                                title: '教师评语',
                                width: '18%',
                                align: 'center',
                                formatter: function(value,row,index) {
                                    if(row.teacherWord && row.teacherWord.trim().length>0){
                                        return "<span title='" + row.teacherWord + "'>" + row.teacherWord + "</span>";
                                    }else{
                                        return '等待教师评审...'
                                    }

                                }
                            },
                            {
                                field: 'passState',
                                title: '审批结果',
                                width: '12%',
                                align: 'center',
                                formatter: function(value,row,index) {
                                    if(row.checkState == 0){
                                        return '等待教师审批...';
                                    }
                                    if(row.checkState == 1){
                                        if(row.passState == 0){
                                            return '未通过';
                                        }else{
                                            return '<span style="color:red;">('+"已通过"+')</span>';
                                        }
                                    }
                                }
                            },
                            {
                                field: 'submitTime',
                                title: '提交时间',
                                width: '12%',
                                align: 'center'
                            },
                            {
                                field: 'judgeTime',
                                title: '审批时间',
                                width: '12%',
                                align: 'center',
                                formatter: function(value,row,index) {
                                    if(row.checkState == 0){
                                        return '尚未审批';
                                    }else{
                                        return value;
                                    }
                                }
                            }
                        ]
                    ]
                });
            },
            error: function (e) {
                errorHandle(e);
            }
        });
    })
</script>
<table id="studentJudgeRecord" class="easyui-datagrid" data-options="enableFilter:true"></table>
</body>
</html>